﻿using System;
using System.Collections.Generic;
using System.Linq;
using ExpenseSystem.Common;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using System.Web;

namespace ExpenseSystem.Fether
{
    public class ModuleFetcher : SystemFetcher<ModuleModel>
    {

        public IList<ModuleModel> ListAdmin(out string message,out int rows)
        {
            IList<ModuleModel> result = List( OrderBy.GetDefault(), Limit.GetDefault(), out message,out rows, Restrain.Eq("Admin", true));
            return result;
        }
        public IList<ModuleModel> ListNormal(out string message,out int rows)
        {
            IList<ModuleModel> result = List( OrderBy.GetDefault(), Limit.GetDefault(), out message, out rows, Restrain.Eq("Admin", false));
            return result;
        }
        public IList<ModuleModel> ListMenu(out string message, out int rows)
        {
            IList<ModuleModel> result = List(new OrderBy[] { new OrderBy("Seq", true) }, Limit.GetDefault(), out message, out rows, Restrain.Eq("Admin", false).And(Restrain.Eq("Main", true)));
            return result;
        }
        public IList<ModuleModel> ListAll( out string message, out int rows)
        {
            IList<ModuleModel> result = List( OrderBy.GetDefault(), Limit.GetDefault(),  out message,out rows);
            return result;
        }
    }
}
